#!usr/bin/env python
# -*- coding:utf-8 -*-

# @Author:   tian
# @project:  infoLog.py

import logging

logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)

stream_handler = logging.StreamHandler()
stream_formatter = logging.Formatter('%(asctime)s -%(message)s')
stream_handler.setFormatter(stream_formatter)
logger.addHandler(stream_handler)

file_handler = logging.FileHandler('scrapy_spider.log')
file_formatter = logging.Formatter('%(asctime)s -%(message)s')
file_handler.setFormatter(file_formatter)
logger.addHandler(file_handler)

if __name__ == '__main__':
    logger.info('server start')

